<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>奉化市诗篇网络科技有限公司-免费投票系统</title>

<link rel="stylesheet" href="/yui/3.3.0/build/cssfonts/fonts.css" type="text/css">
<link rel="stylesheet" href="/yui/3.3.0/build/cssgrids/grids.css" type="text/css">

<script src="/yui/3.4.0/build/yui/yui-min.js"></script>

<script type="text/javascript">
	YUI().use('node','selector-css3','cookie',function(Y){
		if(Y.Cookie.get('_hasvote')){
			alert('你已經投票過啦！');
			return false;
		}
		m3958_vote_form = function(){
			var inputs = Y.all('#vote-form input[type="checkbox"]');
			var dovoteids = "";
			inputs.each(function(inode){
				if(inode.get('checked')){
					dovoteids += inode.get('id').substring(6) + '~';
				}
			});
			if(!dovoteids){
				alert('至少選一個啦！');
				return false;
			}
			Y.log(dovoteids);
			Y.one('#vote-form input[name="dovoteids"]').set('value',dovoteids);
			return true;
		}
	});
</script>
   
<style>
/* everything below is custom styling to demonstrate how to create a page layout using yui grid units */
#doc {
	margin: auto; /* center in viewport */
	width: 970px; /* fix page width */
}

/* arbitrary content styling */
.yui3-g .content {
	border: 1px solid #ccc;
/*	height: 400px;*/
	margin-right: 10px; /* gutter between columns */
}

.yui3-g .content {
	margin-top: 15px;
	margin-bottom: 15px;
}

#hd,#ft {
	height: 40px;
}

#ft{
	margin-top: 80px;
}
#hd h1 {
	font: 20px/1.75 黑体;
}

#pattern-style-b
{
	font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
	font-size: 12px;
	margin: 45px;
	width: 480px;
	text-align: left;
	border-collapse: collapse;
	background: url('http://assets.m3958.com/top10table/table-images/patternb.png');
}

#pattern-style-b thead tr
{
	background: url('http://assets.m3958.com/top10table/table-images/patternb-head.png');
}
#pattern-style-b th
{
	font-size: 13px;
	font-weight: normal;
	padding: 8px;
	border-bottom: 1px solid #fff;
	color: #039;
}
#pattern-style-b td
{
	padding: 8px; 
	border-bottom: 1px solid #fff;
	color: #669;
	border-top: 1px solid transparent;
}
#pattern-style-b tbody tr:hover td
{
	color: #339;
	background: #cdcdee;
}

.btn {
border-style:none;
color:#1951AB;
cursor:pointer;
font-size:14px;
font-weight:bold;
height:27px;
padding:7px;
width:103px;
margin: auto;
}
</style>
</head>
<body id="doc">
<#assign companies = votes[0]>
<#assign cats = votes[1]>
<div id="hd">
<h1>投票站</h1>

</div>

<div class="yui3-g">
<div class="yui3-u-4-5">
<div class="content">
	<form action="http://127.0.0.1:8888/vote" method="post" onsubmit="return m3958_vote_form()" id="vote-form">
	<input type="hidden" name="dovoteids" value=""/>
	<input type="hidden" name="voteids" value="41101-41104"/>
	<input type="hidden" name="tplid" value="41108"/>
	<input type="hidden" name="dovote" value="true"/>
	<table id="pattern-style-b" summary="Meeting Results">
    <thead>
    	<tr>
    		<th scope="col">候选公司</th>
    		<#list cats.children as c>
	        	<th scope="col">${c.name}</th>
        	</#list>
        </tr>
    </thead>
    <tbody>
    	<#list companies.children as cp>
    	<tr>
    		<td>${cp.name}</td>
    		<#list cats.children as c>
	        	<td><input type="checkbox" name="tmpvid" id="tmpvid${cp.id?c}-${c.id?c}"/></td>
        	</#list>
        </tr>
        </#list>
    </tbody>
	</table>
	<input type="submit" name="submitvote" value="确认投票" class="btn">
	</form>
</div>

</div>

<div class="yui3-u-1-5">
<div class="content"></div>
</div>
</div>

<div id="ft">
<div style="text-align: center;"><a href="http://www.m3958.com"
	target="_blank">奉化市诗篇网络科技有限公司</a> <br />
<span style="margin: auto;">&copy;2011</span></div>
</div>

</body>
</html>